import pymongo
import time
myclient = pymongo.MongoClient('mongodb://localhost:27017/')
print(myclient.list_database_names())

localDb = myclient['local']

print(localDb.list_collection_names())

test = localDb['user']


mantData = list()
print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
for i in range(5000000):
    mantData.append({"name" : "李四" , "age" : 20})

#
# user1 = test.insert_one(user1)
# print(user1.inserted_id)
print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
test.insert_many(mantData)
print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
